package Year2021.month10.Day21.Day27;

public class Bus extends Automobile {
    private int numberOfSeats;//座位数;
    public double money2;
    public Bus(String name, String licensePlate, int dailyRent, String currentState, int numberOfSeats) {
        super(name, licensePlate, dailyRent, currentState);
        this.numberOfSeats = numberOfSeats;
    }

    @Override
    public int getNumberOfSeats() {
        return numberOfSeats;
    }

    @Override
    public void setNumberOfSeats(int numberOfSeats) {
        this.numberOfSeats = numberOfSeats;
    }

    @Override
    public void show() {
        System.out.println("客车"+"\t"+getName()+"\t"+"车牌号为"+getLicensePlate()+"\t"+"座位数为"+getNumberOfSeats()+"座"
                +"\t"+"日租金为"+getDailyRent()+"元"+"\t"+getCurrentState());
    }

    @Override
    public double money(int days) {
        if (days>=150){
            money2=days*getDailyRent()*0.6;
            return money2;
        }else if (days>=30){
            money2=days*getDailyRent()*0.7;
            return money2;
        }else if (days>=7){
            money2=days*getDailyRent()*0.8;
            return money2;
        }else if (days>=3){
            money2=days*getDailyRent()*0.9;
            return money2;
        }
        return days*getDailyRent();

    }
}
